﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<ali:Get ID="Ad" Object="Ad" InnerID="Request.QueryString['ID']" Validate="True" />
<ali:Get ID="Position" Object="Position" Guid="Ad[PositionID]" />
<script language="c#" runat="server">
protected string FormatDate(object date)
{
	if (Convert.IsDBNull(date))
		return String.Empty;
	else
		return Convert.ToDateTime(date).ToString("yyyy-MM-dd");
}
</script>
<section data-page="ad_edit" data-title="编辑广告" data-lang="<%=ContentLang%>" data-id="<%=Request.QueryString["ID"]%>">
	<dl class="path1">
		<dt><span>您的位置：</span><a href="../position/list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">广告位列表</a> → <b class="<%=ContentLang%>Font"><%=Position[Name]%></b></dt>
	</dl>
	<form action="?Lang=<%=ContentLang%>" class="post">
		<div class="post-body">
			<div class="ali-tabs" data-event="click">
				<div class="ali-tabs-header">
					<div class="ali-tabs-nav-container">
						<ul>
							<li><a href="../position/edit.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["PositionID"]%>" target="ali-navtab">编辑</a></li>
							<li><a href="list.aspx?Lang=<%=ContentLang%>&amp;PositionID=<%=Request.QueryString["PositionID"]%>" target="ali-navtab">广告列表</a></li>
							<li class="Middle"><a href="add.aspx?Lang=<%=ContentLang%>&amp;PositionID=<%=Position[InnerID]%>" target="ali-navtab">添加广告</a></li>
							<li class="ali-active"><a>编辑广告</a></li>
						</ul>				
					</div>
				</div>
				<div class="ali-tabs-body">
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel">
						<table class="post-table margin2">
							<tr>
								<th>标题：</th>
								<td><input type="text" name="Title" value="<%=Ad[Title]%>" size="50" maxlength="255" class="ali-input <%=ContentLang%>Font"></td>
							</tr>
							<tr>
								<th>尺寸（宽x高）：</th>
								<td>
									<input type="text" name="Width" value="<%=Ad[Width]%>" size="10" maxlength="10" class="ali-input"> x
									<input type="text" name="Height" value="<%=Ad[Height]%>" size="10" maxlength="10" class="ali-input">
								</td>
							</tr>
							<tr>
								<th>图片：</th>
								<td>
									<input type="text" name="Image" value="<%=Ad[Image]%>"  size="55" class="ali-input"><a class="ali-button ali-uploader">浏览...</a><button type="button" class="ali-button" data-operation="SelectImage">选择</button>
									<a href="<%=Ad[Image]%>" target="_blank"><img src="<%=Ad[Image]%>" height="22" alt="图片"></a><label><input type="checkbox">水印</label>
								</td>
							</tr>
							<tr>
								<th>链接：</th>
								<td><input type="text" name="URL" value="<%=Ad[URL]%>" size="50" maxlength="255" class="ali-input"></td>
							</tr>
							<tr>
								<th>代码：</th>
								<td><textarea name="Code" cols="70" rows="6" wrap="off" class="ali-input"><%=HttpUtility.HtmlEncode(Ad[Code].ToString())%></textarea></td>
							</tr>
							<tr>
								<th>开始时间：</th>
								<td><input type="text" name="StartTime" value="<%=FormatDate(Ad[StartTime])%>" readonly size="50" maxlength="255" class="ali-input" data-ali-widget="calendar"></td>
							</tr>
							<tr>
								<th>结束时间：</th>
								<td><input type="text" name="EndTime"value="<%=FormatDate(Ad[EndTime])%>" readonly class="ali-input" data-ali-widget="calendar"></td>
							</tr>
							<tr>
								<th>是否计费：</th>
								<td>
									<%If Convert.ToBoolean(Ad[Charge])%>
										<label><input type="radio" name="Charge" value="true" checked>是</label>
										<label><input type="radio" name="Charge" value="false">否</label>
									<%Else%>
										<label><input type="radio" name="Charge" value="true">是</label>
										<label><input type="radio" name="Charge" value="false" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
							<tr>
								<th>子实例：</th>
								<td><%=Ad[SubInstanceID]%></td>
							</tr>
						</table>
					</div>
				</div>
				<div class="ali-tabs-bottom"><b></b></div>
			</div>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">保 存</button><input type="hidden" name="PictureAllowedType" value="gif|jpg|jpeg|png|bmp|png"></div>
	</form>
</section>